package com.day01.Encapsulation;

import lombok.Data;

//@Data
//public class Person {
    //这样只能内部类访问，外部无法获取到
//    private String name;
//    private int age;

//}
//但是我们可以写get和set方法来调用和复制，或者注解@Data  这个需要引入lombok
public class Person{
    private String name;
    private int age;
    public int getAge(){
        return age;
    }

    public String getName(){
        return name;
    }

    public void setAge(int age){
        this.age = age;
    }

    public void setName(String name){
        this.name = name;
    }
}